using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

public static class RandomUtil
{
    public static T GetRandomElement<T>(List<T> list)
    {
        var count = list.Count;
        if(count == 0)
        {
            throw new Exception("can not get random element form 0 size list");
        }
        var index = UnityEngine.Random.Range(0, count);
        return list[index];
    }
}
